package io.renren.modules.comment.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.comment.dao.UserCommentDao;
import io.renren.modules.comment.entity.UserCommentEntity;
import io.renren.modules.comment.service.UserCommentService;


@Service("userCommentService")
public class UserCommentServiceImpl extends ServiceImpl<UserCommentDao, UserCommentEntity> implements UserCommentService {

    @Autowired
    UserCommentDao userCommentDao;
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<UserCommentEntity> page = this.page(
                new Query<UserCommentEntity>().getPage(params),
                new QueryWrapper<UserCommentEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<UserCommentEntity> findByCarId(Integer carId) {
        return userCommentDao.findByCarId(carId);
    }

}